#!/bin/sh /etc/rc.common

START=96
USE_PROCD=1
path=/usr/bin

service_triggers() {
	procd_add_reload_trigger 'appfilter'
}

start_instance() {
	config_get_bool enable $1 'enable' '0'

	command $path/gen_class.sh /etc/appfilter/feature.cfg
	command $path/appfilter.sh

	[ $enable -ne 0 ] || return 1

	procd_open_instance
	procd_set_param command $path/appfilter
	procd_set_param respawn
	procd_set_param stderr 1
	procd_close_instance
}

start_service() {
	config_load 'appfilter'
	config_foreach start_instance 'global'
}
